<template>
  <div class="experience_board">
    <div class="experience_title">
      <p>沧桑岁月</p>
      <el-divider  content-position="center">Try My Best</el-divider>
    </div>
    <div class="ex_timeline">
      <el-timeline>
        <el-timeline-item  v-for="(item,index) in expList" :key="index"  :timestamp="item.period"  type="warning" size="large" color="#0bbd87" placement="top">
          <el-card shadow="hover" >
            <div slot="header"  class="mycompany">
             <h4>{{item.company}}</h4>
              <p class="job">{{item.position}}</p>
            </div>

            <p v-if="item.jobList" v-for="(job,index) in item.jobList" :key="index" >{{job}}</p>

          </el-card>
        </el-timeline-item>

      </el-timeline>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'myexperience',
    data(){
      return{
          expList:""
      }
    },
    methods:{
      initExperience(){
         this.axios.post("/user/initExperience").then(success =>{
           if (success.data.code == 0) {
               this.expList=success.data.result;
           }
           //todo  处理请求失败！
         }).catch(error =>{

         })
      }
    },
    mounted () {
      this.initExperience()
    }
  }
</script>

<style scoped>
  .experience_board{
       /*background-color: hotpink;*/
        border-radius: 20px;
    /*background-color: rgba(0,0,0,.5);*/


  }
  .experience_board .experience_title{
    height: 60px;
      /*background-color: green;*/
     margin: 0 5%;
     width: 90%;
    overflow: hidden;

  }

  .experience_title  .el-divider{
      background-color: #ffffff;
    margin:0;
  }
  .experience_title .el-divider__text{
    background-color: #b640ff;
    padding: 0 10px;
    color: #e4e4e4;
  }

  .experience_board .experience_title p{
       /*margin-bottom: 20px;*/
       height: 40px;
      width: 100%;
       padding-left: 10px;
      line-height: 40px;
       /*border-bottom: 2px dashed red;*/
  }

  /*-----------时间线--start-----------------*/
   .ex_timeline{
     border:1px solid rgba(0,0,0,.5) ;
     border-radius: 10px ;
     /*background-color: chartreuse;*/
     margin: 0 5%;
     width: 90%;
     padding-top: 20px;
   }
  .ex_timeline .el-timeline{
      margin-left:  2%;
      margin-right: 2%;
  }
  .mycompany{
     padding-bottom: 10px;
  }
  .mycompany h4{
      float: left;
      font-size: 16px;

  }
  .mycompany .job{
      float: right;
    margin-right:30%;
    font-size: 16px;
  }

  .ex_timeline .el-timeline-item__tail{
    border-left: 2px solid red;
  }

  .el-card__header{
    border-bottom: 1px solid red;
  }

  /*-------end-------*/



</style>
